Skip to content

Add unit tests for SpellCheckerManager and refactor core logic #1338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

miurahr
Copy link
Member

@miurahr miurahr commented Apr 12, 2025

Pull request type

  • Other (describe below)
    refactor

Which ticket is resolved?

There is no issue to point

What does this PR change?

  • Add MockIto library for test
  • Add unit tests for SpellCheckerManager
  • make SpellCheckerManager#getCurrentSpellChecker as instance method for testability.

Other information

Introduce tests for `SpellCheckerManager` to validate dictionary paths, language handling, and fallback mechanisms. Refactor `SpellCheckerManager` to allow instance-based usage and integrate it into the core for easier testability and better design. Additionally, update dependencies to include Mockito for mocking in unit tests.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Copy link

❌ Quality checks failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/texia5yrtxkq4

Organized import statements by removing wildcard imports and adding specific ones for better clarity and maintainability. Also ensured the file ends with a newline for consistency with coding standards.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@miurahr
Copy link
Member Author

miurahr commented Apr 23, 2025

In the previous, SpellCheckerManager is final static class. The proposal change class partially non-static method/field.
It would be better to be singleton class instead of static fields.

@miurahr miurahr marked this pull request as draft April 30, 2025 23:22
@miurahr miurahr marked this pull request as ready for review June 1, 2025 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant